package com.bacon.gmall.user.service.impl;

import com.bacon.gmall.model.user.UserAddress;
import com.bacon.gmall.user.mapper.UserAddressMapper;
import com.bacon.gmall.user.service.UserAddressService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author： bacon、
 * @version： 1.0
 * @create： 2021-01-05 21:11
 * @description:
 */
@Service
public class UserAddressServiceImpl implements UserAddressService {

    @Autowired
    private UserAddressMapper userAddressMapper;

    //根据userId查找地址
    @Override
    public List<UserAddress> findUserAddressList(String userId) {
        return userAddressMapper.selectList(new QueryWrapper<UserAddress>().eq("user_id", userId));
    }
}
